<template>
  <div>
    <div>
      <div>建档率</div>

    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts';

export default {
  name: 'Yuan1',
  data() {
    return {
      myChart: null,
      option: {
        tooltip: {
          trigger: 'item'
        },
        legend: {
          top: '5%',
          left: 'center'
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: [
              { value: 735, name: 'Direct' },
              { value: 300, name: '建档率' }
            ]
          }
        ]
      }
    };
  },
  mounted() {
    // 初始化图表
    this.initChart();
  },
  beforeUnmount() {
    // 销毁图表以避免内存泄漏
    if (this.myChart) {
      this.myChart.dispose();
    }
  },
  methods: {
    initChart() {
      const chartDom = document.getElementById('main');
      this.myChart = echarts.init(chartDom);
      this.myChart.setOption(this.option);
    }
  }
};
</script>

<style scoped>
/*#main {*/
/*  width: 600px;*/
/*  height: 400px;*/
/*}*/
</style>
